package main

import "fmt"

type student struct {
	name  string
	age   int
	score int
}

func (stu *student) GetName() string {
	return stu.name
}

type min struct {
	student
	name string
}
type max struct {
	student
}

func main() {
	//继承练习
	//记得加= &min{}，不然只是定义了类型，未分配内存
	var aaa *min = &min{}
	aaa.student.name = "魏正想"
	aaa.student.age = 20
	aaa.student.score = 99
	name := aaa.student.GetName()
	fmt.Println(name)
	aaa.name = "lulu"
	getName := aaa.GetName()
	fmt.Println(getName)
}
